package cn.xf.service.impl;

import cn.xf.dao.IOrdersDao;
import cn.xf.domain.Orders;
import cn.xf.service.IOrdersService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xiaofu
 * @date 2021-05-14 11:56
 * @email dearaf@163.com
 */
@Service
public class OrdersServiceImpl implements IOrdersService {

    @Autowired
    private IOrdersDao ordersDao;

    @Override
    public List<Orders> findAllByPage(Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        return ordersDao.findAllByPage();
    }

    @Override
    public Orders findById(String id) {
        return ordersDao.findById(id);
    }

    @Override
    public List<Orders> findByProductId(String id) {
        return ordersDao.findByProductId(id);
    }
}
